package com.bussiness.system.model;

import com.bussiness.system.dto.MyDeptRoleDto;

import java.util.Date;

public class MyDeptRoleEntity {
    private Long id;

    private Long roleId;

    private Long deptId;

    private String deptRoleStatus;

    private Date gmtCreate;

    private Date gmtModified;

    public MyDeptRoleEntity(Long id, Long roleId, Long deptId, String deptRoleStatus, Date gmtCreate, Date gmtModified) {
        this.id = id;
        this.roleId = roleId;
        this.deptId = deptId;
        this.deptRoleStatus = deptRoleStatus;
        this.gmtCreate = gmtCreate;
        this.gmtModified = gmtModified;
    }

    public MyDeptRoleEntity() {
        super();
    }

    public MyDeptRoleEntity(MyDeptRoleDto myDeptRoleDto){
        this.roleId = Long.parseLong(myDeptRoleDto.getRoleId());
        this.deptId = Long.parseLong(myDeptRoleDto.getDeptId());
        this.deptRoleStatus = myDeptRoleDto.getDeptRoleStatus();
    }

    public void updateEntity(MyDeptRoleEntity myDeptRoleEntity,MyDeptRoleDto myDeptRoleDto){
        myDeptRoleEntity.setId(Long.parseLong(myDeptRoleDto.getId()));
        myDeptRoleEntity.setRoleId(Long.parseLong(myDeptRoleDto.getRoleId()));
        myDeptRoleEntity.setDeptId(Long.parseLong(myDeptRoleDto.getDeptId()));
        myDeptRoleEntity.setDeptRoleStatus(myDeptRoleDto.getDeptRoleStatus());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getDeptRoleStatus() {
        return deptRoleStatus;
    }

    public void setDeptRoleStatus(String deptRoleStatus) {
        this.deptRoleStatus = deptRoleStatus == null ? null : deptRoleStatus.trim();
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }
}